# create-logs-figs.R
# Philips, Andrew Q. "How to Avoid Incorrect Inference (While Gaining Correct Ones) in Dynamic Models". Forthcoming at Political Science Research and Methods. 
# andrew.philips@colorado.edu
# 2/13/21
# File runs all .R scripts and creates both .txt log files as well as figures
# ------------------------------------------------------------------------
rm(list = ls())
setwd("~/Dropbox/My_Folder/Papers-Projects/Wlezien-Enns-PSRM/Final-Feb2021/scripts/")

# RAN, FIGURES CHECKED (DONE)
# yI0-xI0.R: Figures 1, 2 (main document), 1, 2, 3, 5, 4, 6 (SI)
sink("./log-yI0-xI0.R.txt")
source("yI0-xI0.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI0-xI1.R: Figures 3 (main document), 7, 8, 9 (SI)
sink("./log-yI0-xI1.R.txt")
source("yI0-xI1.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI1-xI0.R: Figures 4 (main document), 10, 11, 12 (SI)
sink("./log-yI1-xI0.R.txt")
source("yI1-xI0.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI1-xI1.R: Figures 5 (main document), 13, 14, 15 (SI)
sink("./log-yI1-xI1.R.txt")
source("yI1-xI1.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# type2-stationary.R: Figures 21, 22 (SI), 6 (main document), 16, 17, 18, 19, 20 (SI)
sink("./log-type2-stationary.R.txt")
source("type2-stationary.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# type2-cointegrating.R: Figures 28, 29 (SI), 7 (main document), 23, 24, 25, 26, 27 (SI)
sink("./log-type2-cointegrating.R.txt")
source("type2-cointegrating.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI0-xI0-EMWproposal.R: FIgure 30 (SI)
sink("./log-yI0-xI0-EMWproposal.R.txt")
source("yI0-xI0-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI0-xI1-EMWproposal.R: Figure 31 (SI)
sink("./log-yI0-xI1-EMWproposal.R.txt")
source("yI0-xI1-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI1-xI0-EMWproposal.R: Figure 32 (SI)
sink("./log-yI1-xI0-EMWproposal.R.txt")
source("yI1-xI0-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI1-xI1-EMWproposal.R: Figure 33 (SI)
sink("./log-yI1-xI1-EMWproposal.R.txt")
source("yI1-xI1-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI0-xI0-related-EMWproposal.R: Figures 34, 35 (SI)
sink("./log-yI0-xI0-related-EMWproposal.R.txt")
source("yI0-xI0-related-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI0-xI0-related-2iv-EMWproposal.R: Figures 36, 37 (SI)
sink("./log-yI0-xI0-related-2iv-EMWproposal.R.txt")
source("yI0-xI0-related-2iv-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI1-xI1-related-EMWproposal.R: Figure 38 (SI)
sink("./log-yI1-xI1-related-EMWproposal.R.txt")
source("yI1-xI1-related-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()

# RAN, FIGURES CHECKED (DONE)
# yI1-xI1-related-2iv-EMWproposal.R: Figure 39 (SI)
sink("./log-yI1-xI1-related-2iv-EMWproposal.R.txt")
source("yI1-xI1-related-2iv-EMWproposal.R",echo=T, max.deparse.length=1e3)
sink()


